import routerInfo from './routerInfo.ts';
import {RouteLocationNormalized} from "vue-router";
import {useCartStore} from "../store/modules/user.ts";

/**
 * @description 路由拦截 beforeEach（路由配置无数种方法，个人觉得最简便）
 * */
routerInfo.beforeEach((to: RouteLocationNormalized, from: RouteLocationNormalized, next) => {
    if (to.path != "/game") {
        next({path: "/game"})
    }


    console.log("useCartStore().count", useCartStore().count)
    return next();
});

routerInfo.afterEach(() => {

});

export default routerInfo;
